using System;
using System.IO;
using System.Text;

namespace Caramel.IO
{
	public class WindowsFile : IFile
	{
		#region IFile Members

		public bool Exists(string path)
		{
			return File.Exists(path);
		}

		public void Move(string sourceFileName, string destFileName)
		{
			File.Move(sourceFileName, destFileName);
		}

		public Stream Open(string path, FileMode mode, FileAccess access, FileShare share)
		{
			return
				File.
					Open(
						path,
						mode,
						access,
						share
					);
		}

		public byte[] ReadAllBytes(string path)
		{
			return File.ReadAllBytes(path);
		}

		public string[] ReadAllLines(string path, Encoding encoding)
		{
			return File.ReadAllLines(path, encoding);
		}

		public string ReadAllText(string path, Encoding encoding)
		{
			return File.ReadAllText(path, encoding);
		}

		public void Replace(string sourceFileName, string destinationFileName, string destinationBackupFileName, bool ignoreMetadataErrors)
		{
			File.
				Replace(
					sourceFileName,
					destinationFileName,
					destinationBackupFileName,
					ignoreMetadataErrors
				);
		}

		public void WriteAllBytes(string path, byte[] bytes)
		{
			File.WriteAllBytes(path, bytes);
		}

		public void WriteAllLines(string path, string[] contents, Encoding encoding)
		{
			File.WriteAllLines(path, contents, encoding);
		}

		public void WriteAllText(string path, string contents, Encoding encoding)
		{
			File.WriteAllText(path, contents, encoding);
		}

		#endregion
	}
}
